<template>
	<view class="content" style="padding-bottom: 180rpx;">
		<view class="fz14 c3 p16">
			被邀请房东注册时输入邀请码即可成功邀请，成功 邀请房东后可获取佣金。
		</view>
		<view class="bg-white pt10" style="position: relative;">
			<image src="https://www.szchangen.com/admin-api/infra/file/18/get/bg-invite.jpg" style="width: 100%;" mode="widthFix"></image>

			<view class="u-flex u-f-jsb fz14 c255 p20" style="position: absolute;bottom: 0;left: 0;right: 0;">
				<view>
					<u-avatar size="50" :src="userInfo.avatar"></u-avatar>

					<view>{{userInfo.name}}</view>
				</view>
				<view>
					我的邀请码
					<view class="fz24 u-font-bold">{{userInfo.recommendOneselfCode}}</view>
				</view>
			</view>
		</view>
		<view class="fixed-bottom">
			<view class="btn" style="background: #F24646;" @click="toSave('http://139.199.14.156:8302/admin-api/infra/file/18/get/bg-invite.jpg')">保存图片</view>
		</view>
	</view>
</template>

<script>
	export default {

		data() {
			return {
				dataList: [],
				curId: 7,
				userInfo: {},
			}
		},
		onShareAppMessage(e) {},
		// #ifdef MP-WEIXIN
		onShareTimeline() {
			return this.mpShare
		},
		// #endif
		onLoad(e) {

			this.$api.memberInfo({}, res => {
				if (res.code == 200) {
					this.isLogin = true
					this.userInfo = res.data;
				}
			})
		},
		methods: {
			
			toSave(imagePath){
				// 保存图片到相册
				uni.saveImageToPhotosAlbum({
				    filePath: imagePath,
				    success: function () {
				        console.log('图片保存成功');
				        // 成功处理逻辑
				    },
				    fail: function (err) {
				        console.log('图片保存失败', err);
				        // 失败处理逻辑
				    }
				});
			}
		}
	}
</script>

<style lang="scss">
</style>
<view class="btn" style="background: #F24646;